]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Do not remove destroyed actors from their container
authorGiovanni Campagna <gcampagna@src.gnome.org>
Thu, 28 Oct 2010 20:28:17 +0000 (22:28 +0200)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Fri, 29 Oct 2010 18:05:32 +0000 (20:05 +0200)
The container already connects to destroy and will do that for us,
preventing a warning.

https://bugzilla.gnome.org/show_bug.cgi?id=633028

js/ui/popupMenu.js

index f572e13549e28cf025d1d95e04de85212864b956..51b2989d8fc824a72657abf79c71ed942d540c89 100644 (file)
@@ -155,20 +155,24 @@ PopupBaseMenuItem.prototype = {
         this._children.push({ actor: child,
                               column: column,
                               span: span });
-        this.actor.connect('destroy', Lang.bind(this, function () { this.removeActor(child); }));
+        this.actor.connect('destroy', Lang.bind(this, function () { this._removeChild(child); }));
         this.actor.add_actor(child);
     },
 
-    removeActor: function(child) {
+    _removeChild: function(child) {
         for (let i = 0; i < this._children.length; i++) {
             if (this._children[i].actor == child) {
                 this._children.splice(i, 1);
-                this.actor.remove_actor(child);
                 return;
             }
         }
     },
 
+    removeActor: function(child) {
+        this.actor.remove_actor(child);
+        this._removeChild(child);
+    },
+
     setShowDot: function(show) {
         if (show) {
             if (this._dot)